<template>
  <div class="allnew">
        <ul class="newsul">
          <li class="newssecond" v-for="(item,index) in allnews" :key="index">
            <nuxt-link target="_blank" :to="'/post/' + item.pid">
              <span>{{item.name}}</span>
              <span>{{item.createtime.slice(0,11)}}</span>
            </nuxt-link>
          </li>
        </ul>
  </div>
</template>


<script>
import asyncApi from "../../static/js/asyncApi.js";
export default {
  head() {
    return {
      title: "新闻列表"
    };
  },
  mounted() {
    
  },
  async asyncData() {
    let [data1] = await Promise.all([
      asyncApi.asyncGetCategoryPost({pageSize: "1000", orderBy: "createtime",orderByType: "desc",nocategoryName:"理财师自己的文章"})
    ])
    return {
      allnews: data1.data.data.list
    };
  }
};
</script>

<style scoped>
.allnew{
  width: 1200px;
  box-sizing: border-box;
  margin: 10px auto;
  padding: 30px 60px;
  background: white;
}
.newsul li{
  height: 50px;
  line-height: 50px;
  font-size: 18px;
}
.newsul li:hover{
  color: #cd9c54;
}
.newsul li a{
  display: flex;
  justify-content: space-between;
}
.newsul li a span:nth-child(1){
  width: 800px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>
